module RulesHelper
  def rules_index_fields(options)
    %w[id search_query actions]
  end
  def rules_format_field(obj, field, options)
    case field
    when "id"
      "#" + obj.id.to_s.rjust(3, "0")
    when "actions"
      link_to("Delete", rule_path(obj), :method => :delete, :confirm => "Are you sure you want to delete this rule?")
    when "search_query"
      obj.query
    else obj.send(field)
    end
  end
  
  def rules_index_links(objs, options)
    []
  end
end